﻿using SteamFluentAPI.Infrastructure.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SteamFluentAPI.Infrastructure
{
    public class PlayerService : SteamInterface
    {
        /// <summary>
        /// Returns a list of player's recently played games.
        /// </summary>
        [SteamMethod("v1")]
        public GetRecentlyPlayedGames GetRecentlyPlayedGames { get { return new GetRecentlyPlayedGames(); } }

        /// <summary>
        /// Returns a list of player's owned games.
        /// </summary>
        [SteamMethod("v1")]
        public GetOwnedGames GetOwnedGames { get { return new GetOwnedGames(); } }
    }

    public class GetRecentlyPlayedGames : SteamIDMethod
    {
        /// <summary>
        /// The number of games to return. (OPTIONAL)
        /// </summary>
        /// <param name="count"></param>
        public void Count(int count)
        {
            Add("count", count);
        }
    }

    public class GetOwnedGames : SteamIDMethod
    {
        /// <summary>
        /// Whether or not to include additional details of apps - name and images. Defaults to false. (OPTIONAL)
        /// </summary>
        /// <param name="include_appinfo"></param>
        public void IncludeAppInfo(bool include_appinfo = false)
        {
            Add("include_appinfo", include_appinfo);
        }

        /// <summary>
        /// Whether or not to list free-to-play games in the results. Defaults to false. (OPTIONAL)
        /// </summary>
        /// <param name="include_played_free_games"></param>
        public void IncludePlayedFreeGames(bool include_played_free_games = false)
        {
            Add("include_played_free_games ", include_played_free_games);
        }

        /// <summary>
        /// Restricts results to the appids passed here; does not seem to work as of 31 Mar 2013. (OPTIONAL)
        /// </summary>
        /// <param name="appids"></param>
        public void AppIDsFilter(params int[] appids)
        {
            Add("appids_filter", appids.ToDelimitedString());
        }
    }
}
